{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "131f8b1d",
   "metadata": {},
   "source": [
    "---\n",
    "- 时间：2002-9-26 \n",
    "- 课堂笔记：week06\n",
    "- 记录人：马梓杰\n",
    "\n",
    "---"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e2752dd7",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 请判读今天是周几，如果是周一，有python课，好开心啊。如果不是，期待周一呀。\n",
    "# （time可以帮我们知道今天的的日期，周几）\n",
    "# 如果是周一，请判断现在是否在上python课。\n",
    "# （time可以帮我们知道现在是几点几分"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "94c3d413",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "h\n",
      "i\n",
      "!\n"
     ]
    }
   ],
   "source": [
    "for k in \"hi!\" :\n",
    "    print(k)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "15f50398",
   "metadata": {},
   "source": [
    "## 1. 本周知识点\n",
    "\n",
    "- 1. 随机函数\n",
    "- 2. 时间函数"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "c104c93f",
   "metadata": {},
   "source": [
    "# 1.随机函数\n",
    "> 1. random.random():生成随机数  0-1之间随机数\n",
    "> 2. random.randint():生成随机数 \n",
    "> 3. random.choices():随机抽样"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "21f0d0ee",
   "metadata": {},
   "outputs": [],
   "source": [
    "import random"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "56291e8b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on built-in function random:\n",
      "\n",
      "random() method of random.Random instance\n",
      "    random() -> x in the interval [0, 1).\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(random.random)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "30d20812",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "0.41708043775532766"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "random.random()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "e9630eeb",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Help on method randint in module random:\n",
      "\n",
      "randint(a, b) method of random.Random instance\n",
      "    Return random integer in range [a, b], including both end points.\n",
      "\n"
     ]
    }
   ],
   "source": [
    "help(random.randint)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "d20da542",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "random.randint(0,6)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "ea8f483d",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "6\n",
      "6\n",
      "2\n",
      "4\n",
      "4\n"
     ]
    }
   ],
   "source": [
    "# randint小实践：大话骰\n",
    "for i in range(5):\n",
    "    print(random.randint(1,6))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "bba75464",
   "metadata": {},
   "outputs": [],
   "source": [
    "# randint 小实践：猜数字:0-100"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "5cd28e3c",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'alex'"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# random.choice(),在数据组（列表）随机选择一个值\n",
    "random.choice([\"alex\",\"xiaohong\"])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "e465fe95",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "6\n",
      "82\n",
      "61\n",
      "76\n",
      "81\n",
      "57\n"
     ]
    }
   ],
   "source": [
    "# 通过随机值，大概去判断一下彩票的中奖概率\n",
    "[12,34,64,10,22,12]\n",
    "for i in range(6):\n",
    "    print(random.randint(0,99))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "f49b2531",
   "metadata": {},
   "outputs": [],
   "source": [
    "import time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "70d0a2bb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "time.struct_time(tm_year=2022, tm_mon=9, tm_mday=26, tm_hour=10, tm_min=27, tm_sec=10, tm_wday=0, tm_yday=269, tm_isdst=0)"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.localtime()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "36304d2f",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "hello world\n"
     ]
    }
   ],
   "source": [
    "time.sleep(2)\n",
    "print(\"hello world\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9d956f2d",
   "metadata": {
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "help(time.sleep)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "369c75ce",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 实践：浏览抓取网页数据，模拟人的行为，让机器慢下来，每执行一次休息3秒钟\n",
    "#  进阶，随机产生一个数，让程序停留随机的秒数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "3c8799e6",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "数据获取...\n",
      "https://www.nfu.edu.cn/tzgg/index0.htm\n",
      "页面停留 12 秒\n",
      "数据获取...\n",
      "https://www.nfu.edu.cn/tzgg/index1.htm\n",
      "页面停留 3 秒\n",
      "数据获取...\n",
      "https://www.nfu.edu.cn/tzgg/index2.htm\n",
      "页面停留 3 秒\n",
      "数据获取...\n",
      "https://www.nfu.edu.cn/tzgg/index3.htm\n",
      "页面停留 11 秒\n",
      "数据获取...\n",
      "https://www.nfu.edu.cn/tzgg/index4.htm\n",
      "页面停留 6 秒\n",
      "数据获取...\n",
      "https://www.nfu.edu.cn/tzgg/index5.htm\n",
      "页面停留 20 秒\n",
      "数据获取...\n",
      "https://www.nfu.edu.cn/tzgg/index6.htm\n",
      "页面停留 20 秒\n",
      "数据获取...\n",
      "https://www.nfu.edu.cn/tzgg/index7.htm\n",
      "页面停留 10 秒\n",
      "数据获取...\n",
      "https://www.nfu.edu.cn/tzgg/index8.htm\n",
      "页面停留 13 秒\n",
      "数据获取...\n",
      "https://www.nfu.edu.cn/tzgg/index9.htm\n",
      "页面停留 5 秒\n"
     ]
    }
   ],
   "source": [
    "import time\n",
    "import random\n",
    "for page in range(10):\n",
    "    print(\"数据获取...\")\n",
    "    wait_time = random.randint(3,30)\n",
    "    print(\"https://www.nfu.edu.cn/tzgg/index%d.htm\" % page)\n",
    "    time.sleep(wait_time)\n",
    "    print(\"页面停留\", wait_time,\"秒\")\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "d804db83",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "当前是奇数秒.\n",
      "等待时间（随机）： 33\n",
      "---------\n",
      "当前是偶数秒.\n",
      "等待时间（随机）： 39\n",
      "---------\n",
      "当前是奇数秒.\n",
      "等待时间（随机）： 29\n",
      "---------\n",
      "当前是奇数秒.\n",
      "等待时间（随机）： 32\n",
      "---------\n",
      "当前是偶数秒.\n",
      "等待时间（随机）： 9\n",
      "---------\n"
     ]
    }
   ],
   "source": [
    "from datetime import datetime\n",
    "import random\n",
    "import time\n",
    "\n",
    "odds = [ 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35,\n",
    "         37, 39, 41, 43, 45, 51, 53, 55, 57, 59 ]\n",
    "\n",
    "for i in range(5):\n",
    "    right_this_minute = datetime.today().minute\n",
    "    if right_this_minute in odds:\n",
    "        print(\"当前是奇数秒.\")\n",
    "    else:\n",
    "        print(\"当前是偶数秒.\")\n",
    "    wait_time = random.randint(1,60)\n",
    "    print(\"等待时间（随机）：\", wait_time)\n",
    "    time.sleep(wait_time)\n",
    "    print(\"---------\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "e5a7b471",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "99 bottles 在啤酒墙上.\n",
      "99 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "98 bottles 在啤酒墙上.\n",
      "------------\n",
      "98 bottles 在啤酒墙上.\n",
      "98 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "97 bottles 在啤酒墙上.\n",
      "------------\n",
      "97 bottles 在啤酒墙上.\n",
      "97 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "96 bottles 在啤酒墙上.\n",
      "------------\n",
      "96 bottles 在啤酒墙上.\n",
      "96 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "95 bottles 在啤酒墙上.\n",
      "------------\n",
      "95 bottles 在啤酒墙上.\n",
      "95 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "94 bottles 在啤酒墙上.\n",
      "------------\n",
      "94 bottles 在啤酒墙上.\n",
      "94 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "93 bottles 在啤酒墙上.\n",
      "------------\n",
      "93 bottles 在啤酒墙上.\n",
      "93 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "92 bottles 在啤酒墙上.\n",
      "------------\n",
      "92 bottles 在啤酒墙上.\n",
      "92 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "91 bottles 在啤酒墙上.\n",
      "------------\n",
      "91 bottles 在啤酒墙上.\n",
      "91 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "90 bottles 在啤酒墙上.\n",
      "------------\n",
      "90 bottles 在啤酒墙上.\n",
      "90 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "89 bottles 在啤酒墙上.\n",
      "------------\n",
      "89 bottles 在啤酒墙上.\n",
      "89 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "88 bottles 在啤酒墙上.\n",
      "------------\n",
      "88 bottles 在啤酒墙上.\n",
      "88 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "87 bottles 在啤酒墙上.\n",
      "------------\n",
      "87 bottles 在啤酒墙上.\n",
      "87 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "86 bottles 在啤酒墙上.\n",
      "------------\n",
      "86 bottles 在啤酒墙上.\n",
      "86 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "85 bottles 在啤酒墙上.\n",
      "------------\n",
      "85 bottles 在啤酒墙上.\n",
      "85 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "84 bottles 在啤酒墙上.\n",
      "------------\n",
      "84 bottles 在啤酒墙上.\n",
      "84 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "83 bottles 在啤酒墙上.\n",
      "------------\n",
      "83 bottles 在啤酒墙上.\n",
      "83 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "82 bottles 在啤酒墙上.\n",
      "------------\n",
      "82 bottles 在啤酒墙上.\n",
      "82 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "81 bottles 在啤酒墙上.\n",
      "------------\n",
      "81 bottles 在啤酒墙上.\n",
      "81 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "80 bottles 在啤酒墙上.\n",
      "------------\n",
      "80 bottles 在啤酒墙上.\n",
      "80 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "79 bottles 在啤酒墙上.\n",
      "------------\n",
      "79 bottles 在啤酒墙上.\n",
      "79 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "78 bottles 在啤酒墙上.\n",
      "------------\n",
      "78 bottles 在啤酒墙上.\n",
      "78 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "77 bottles 在啤酒墙上.\n",
      "------------\n",
      "77 bottles 在啤酒墙上.\n",
      "77 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "76 bottles 在啤酒墙上.\n",
      "------------\n",
      "76 bottles 在啤酒墙上.\n",
      "76 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "75 bottles 在啤酒墙上.\n",
      "------------\n",
      "75 bottles 在啤酒墙上.\n",
      "75 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "74 bottles 在啤酒墙上.\n",
      "------------\n",
      "74 bottles 在啤酒墙上.\n",
      "74 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "73 bottles 在啤酒墙上.\n",
      "------------\n",
      "73 bottles 在啤酒墙上.\n",
      "73 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "72 bottles 在啤酒墙上.\n",
      "------------\n",
      "72 bottles 在啤酒墙上.\n",
      "72 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "71 bottles 在啤酒墙上.\n",
      "------------\n",
      "71 bottles 在啤酒墙上.\n",
      "71 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "70 bottles 在啤酒墙上.\n",
      "------------\n",
      "70 bottles 在啤酒墙上.\n",
      "70 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "69 bottles 在啤酒墙上.\n",
      "------------\n",
      "69 bottles 在啤酒墙上.\n",
      "69 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "68 bottles 在啤酒墙上.\n",
      "------------\n",
      "68 bottles 在啤酒墙上.\n",
      "68 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "67 bottles 在啤酒墙上.\n",
      "------------\n",
      "67 bottles 在啤酒墙上.\n",
      "67 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "66 bottles 在啤酒墙上.\n",
      "------------\n",
      "66 bottles 在啤酒墙上.\n",
      "66 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "65 bottles 在啤酒墙上.\n",
      "------------\n",
      "65 bottles 在啤酒墙上.\n",
      "65 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "64 bottles 在啤酒墙上.\n",
      "------------\n",
      "64 bottles 在啤酒墙上.\n",
      "64 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "63 bottles 在啤酒墙上.\n",
      "------------\n",
      "63 bottles 在啤酒墙上.\n",
      "63 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "62 bottles 在啤酒墙上.\n",
      "------------\n",
      "62 bottles 在啤酒墙上.\n",
      "62 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "61 bottles 在啤酒墙上.\n",
      "------------\n",
      "61 bottles 在啤酒墙上.\n",
      "61 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "60 bottles 在啤酒墙上.\n",
      "------------\n",
      "60 bottles 在啤酒墙上.\n",
      "60 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "59 bottles 在啤酒墙上.\n",
      "------------\n",
      "59 bottles 在啤酒墙上.\n",
      "59 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "58 bottles 在啤酒墙上.\n",
      "------------\n",
      "58 bottles 在啤酒墙上.\n",
      "58 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "57 bottles 在啤酒墙上.\n",
      "------------\n",
      "57 bottles 在啤酒墙上.\n",
      "57 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "56 bottles 在啤酒墙上.\n",
      "------------\n",
      "56 bottles 在啤酒墙上.\n",
      "56 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "55 bottles 在啤酒墙上.\n",
      "------------\n",
      "55 bottles 在啤酒墙上.\n",
      "55 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "54 bottles 在啤酒墙上.\n",
      "------------\n",
      "54 bottles 在啤酒墙上.\n",
      "54 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "53 bottles 在啤酒墙上.\n",
      "------------\n",
      "53 bottles 在啤酒墙上.\n",
      "53 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "52 bottles 在啤酒墙上.\n",
      "------------\n",
      "52 bottles 在啤酒墙上.\n",
      "52 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "51 bottles 在啤酒墙上.\n",
      "------------\n",
      "51 bottles 在啤酒墙上.\n",
      "51 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "50 bottles 在啤酒墙上.\n",
      "------------\n",
      "50 bottles 在啤酒墙上.\n",
      "50 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "49 bottles 在啤酒墙上.\n",
      "------------\n",
      "49 bottles 在啤酒墙上.\n",
      "49 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "48 bottles 在啤酒墙上.\n",
      "------------\n",
      "48 bottles 在啤酒墙上.\n",
      "48 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "47 bottles 在啤酒墙上.\n",
      "------------\n",
      "47 bottles 在啤酒墙上.\n",
      "47 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "46 bottles 在啤酒墙上.\n",
      "------------\n",
      "46 bottles 在啤酒墙上.\n",
      "46 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "45 bottles 在啤酒墙上.\n",
      "------------\n",
      "45 bottles 在啤酒墙上.\n",
      "45 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "44 bottles 在啤酒墙上.\n",
      "------------\n",
      "44 bottles 在啤酒墙上.\n",
      "44 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "43 bottles 在啤酒墙上.\n",
      "------------\n",
      "43 bottles 在啤酒墙上.\n",
      "43 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "42 bottles 在啤酒墙上.\n",
      "------------\n",
      "42 bottles 在啤酒墙上.\n",
      "42 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "41 bottles 在啤酒墙上.\n",
      "------------\n",
      "41 bottles 在啤酒墙上.\n",
      "41 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "40 bottles 在啤酒墙上.\n",
      "------------\n",
      "40 bottles 在啤酒墙上.\n",
      "40 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "39 bottles 在啤酒墙上.\n",
      "------------\n",
      "39 bottles 在啤酒墙上.\n",
      "39 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "38 bottles 在啤酒墙上.\n",
      "------------\n",
      "38 bottles 在啤酒墙上.\n",
      "38 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "37 bottles 在啤酒墙上.\n",
      "------------\n",
      "37 bottles 在啤酒墙上.\n",
      "37 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "36 bottles 在啤酒墙上.\n",
      "------------\n",
      "36 bottles 在啤酒墙上.\n",
      "36 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "35 bottles 在啤酒墙上.\n",
      "------------\n",
      "35 bottles 在啤酒墙上.\n",
      "35 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "34 bottles 在啤酒墙上.\n",
      "------------\n",
      "34 bottles 在啤酒墙上.\n",
      "34 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "33 bottles 在啤酒墙上.\n",
      "------------\n",
      "33 bottles 在啤酒墙上.\n",
      "33 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "32 bottles 在啤酒墙上.\n",
      "------------\n",
      "32 bottles 在啤酒墙上.\n",
      "32 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "31 bottles 在啤酒墙上.\n",
      "------------\n",
      "31 bottles 在啤酒墙上.\n",
      "31 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "30 bottles 在啤酒墙上.\n",
      "------------\n",
      "30 bottles 在啤酒墙上.\n",
      "30 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "29 bottles 在啤酒墙上.\n",
      "------------\n",
      "29 bottles 在啤酒墙上.\n",
      "29 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "28 bottles 在啤酒墙上.\n",
      "------------\n",
      "28 bottles 在啤酒墙上.\n",
      "28 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "27 bottles 在啤酒墙上.\n",
      "------------\n",
      "27 bottles 在啤酒墙上.\n",
      "27 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "26 bottles 在啤酒墙上.\n",
      "------------\n",
      "26 bottles 在啤酒墙上.\n",
      "26 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "25 bottles 在啤酒墙上.\n",
      "------------\n",
      "25 bottles 在啤酒墙上.\n",
      "25 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "24 bottles 在啤酒墙上.\n",
      "------------\n",
      "24 bottles 在啤酒墙上.\n",
      "24 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "23 bottles 在啤酒墙上.\n",
      "------------\n",
      "23 bottles 在啤酒墙上.\n",
      "23 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "22 bottles 在啤酒墙上.\n",
      "------------\n",
      "22 bottles 在啤酒墙上.\n",
      "22 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "21 bottles 在啤酒墙上.\n",
      "------------\n",
      "21 bottles 在啤酒墙上.\n",
      "21 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "20 bottles 在啤酒墙上.\n",
      "------------\n",
      "20 bottles 在啤酒墙上.\n",
      "20 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "19 bottles 在啤酒墙上.\n",
      "------------\n",
      "19 bottles 在啤酒墙上.\n",
      "19 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "18 bottles 在啤酒墙上.\n",
      "------------\n",
      "18 bottles 在啤酒墙上.\n",
      "18 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "17 bottles 在啤酒墙上.\n",
      "------------\n",
      "17 bottles 在啤酒墙上.\n",
      "17 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "16 bottles 在啤酒墙上.\n",
      "------------\n",
      "16 bottles 在啤酒墙上.\n",
      "16 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "15 bottles 在啤酒墙上.\n",
      "------------\n",
      "15 bottles 在啤酒墙上.\n",
      "15 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "14 bottles 在啤酒墙上.\n",
      "------------\n",
      "14 bottles 在啤酒墙上.\n",
      "14 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "13 bottles 在啤酒墙上.\n",
      "------------\n",
      "13 bottles 在啤酒墙上.\n",
      "13 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "12 bottles 在啤酒墙上.\n",
      "------------\n",
      "12 bottles 在啤酒墙上.\n",
      "12 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "11 bottles 在啤酒墙上.\n",
      "------------\n",
      "11 bottles 在啤酒墙上.\n",
      "11 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "10 bottles 在啤酒墙上.\n",
      "------------\n",
      "10 bottles 在啤酒墙上.\n",
      "10 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "9 bottles 在啤酒墙上.\n",
      "------------\n",
      "9 bottles 在啤酒墙上.\n",
      "9 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "8 bottles 在啤酒墙上.\n",
      "------------\n",
      "8 bottles 在啤酒墙上.\n",
      "8 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "7 bottles 在啤酒墙上.\n",
      "------------\n",
      "7 bottles 在啤酒墙上.\n",
      "7 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "6 bottles 在啤酒墙上.\n",
      "------------\n",
      "6 bottles 在啤酒墙上.\n",
      "6 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "5 bottles 在啤酒墙上.\n",
      "------------\n",
      "5 bottles 在啤酒墙上.\n",
      "5 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "4 bottles 在啤酒墙上.\n",
      "------------\n",
      "4 bottles 在啤酒墙上.\n",
      "4 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "3 bottles 在啤酒墙上.\n",
      "------------\n",
      "3 bottles 在啤酒墙上.\n",
      "3 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "2 bottles 在啤酒墙上.\n",
      "------------\n",
      "2 bottles 在啤酒墙上.\n",
      "2 bottles 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "1 bottle 在啤酒墙上.\n",
      "------------\n",
      "1 bottle 在啤酒墙上.\n",
      "1 bottle 啤酒\n",
      "拿下来一瓶给我吧\n",
      "啤酒杯拿走一瓶了.\n",
      "只剩一瓶了，不能给你了，要放在墙上展示.\n",
      "------------\n"
     ]
    }
   ],
   "source": [
    "word = \"bottles\" # 赋予变量\n",
    "\n",
    "for beer_num in range(99,0,-1):  #指定循环次数的起始、顺序和步长\n",
    "    print(beer_num, word, \"在啤酒墙上.\")\n",
    "    print(beer_num, word, \"啤酒\") # 输出数字依次减一的歌词\n",
    "    print(\"拿下来一瓶给我吧\")\n",
    "    print(\"啤酒杯拿走一瓶了.\") # 拿酒歌词\n",
    "    if beer_num == 1:  # 条件判断，当beer_num 等于1时，意味着拿走了墙上最后一瓶酒，歌词到最后一句\n",
    "        print(\"只剩一瓶了，不能给你了，要放在墙上展示.\")\n",
    "    else:  # 条件判断，beer_num未到1时，墙上的酒被依次持续拿下，赋予新变量，输出墙上还剩new_num = beer_num - 1 瓶酒歌词\n",
    "        new_num = beer_num - 1\n",
    "        if new_num == 1:\n",
    "            word = \"bottle\" # 还剩一瓶时 bottle 单数\n",
    "        print(new_num, word, \"在啤酒墙上.\") #输出墙上还剩new_num = beer_num - 1 瓶酒歌词\n",
    "    print(\"------------\")# 终止程序\n",
    "\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "99d1a86d",
   "metadata": {},
   "source": [
    "## 3. 有序的数据结构（）\n",
    "> 1. 数值\n",
    ">> 1. \n",
    "\n",
    "> 2. 字符串\n",
    "\n",
    "> 3. 列表，元组，字典，*集合（期中考核） p144前"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "25d1bfdd",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 有序文本——str"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "97c5154d",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "id": "65dc22cd",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4.0"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "8/2\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "21cc3c2d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "4.25"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "17/4# 取整数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "3fbed708",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "17%5 # 取余数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "9fbdf89a",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "25"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "5**2 # 5的平方"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "10d2bde2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2.23606797749979"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\n",
    "5**(1/2)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "id": "32ec983e",
   "metadata": {},
   "outputs": [],
   "source": [
    "# numeric types -- int, float, complex"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "79a27511",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "87442376",
   "metadata": {},
   "outputs": [],
   "source": [
    "pd.read_html()[]# 爬取表格,[]填页面中的表格次序"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "1b529ad4",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "cd3dc16b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>Operation</th>\n",
       "      <th>Result</th>\n",
       "      <th>Notes</th>\n",
       "      <th>Full documentation</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>x + y</td>\n",
       "      <td>sum of x and y</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>x - y</td>\n",
       "      <td>difference of x and y</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>x * y</td>\n",
       "      <td>product of x and y</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>x / y</td>\n",
       "      <td>quotient of x and y</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>x // y</td>\n",
       "      <td>floored quotient of x and y</td>\n",
       "      <td>(1)</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>x % y</td>\n",
       "      <td>remainder of x / y</td>\n",
       "      <td>(2)</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>-x</td>\n",
       "      <td>x negated</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>+x</td>\n",
       "      <td>x unchanged</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>abs(x)</td>\n",
       "      <td>absolute value or magnitude of x</td>\n",
       "      <td>NaN</td>\n",
       "      <td>abs()</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>int(x)</td>\n",
       "      <td>x converted to integer</td>\n",
       "      <td>(3)(6)</td>\n",
       "      <td>int()</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>float(x)</td>\n",
       "      <td>x converted to floating point</td>\n",
       "      <td>(4)(6)</td>\n",
       "      <td>float()</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>complex(re, im)</td>\n",
       "      <td>a complex number with real part re, imaginary ...</td>\n",
       "      <td>(6)</td>\n",
       "      <td>complex()</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>c.conjugate()</td>\n",
       "      <td>conjugate of the complex number c</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>divmod(x, y)</td>\n",
       "      <td>the pair (x // y, x % y)</td>\n",
       "      <td>(2)</td>\n",
       "      <td>divmod()</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>pow(x, y)</td>\n",
       "      <td>x to the power y</td>\n",
       "      <td>(5)</td>\n",
       "      <td>pow()</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>x ** y</td>\n",
       "      <td>x to the power y</td>\n",
       "      <td>(5)</td>\n",
       "      <td>NaN</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "          Operation                                             Result  \\\n",
       "0             x + y                                     sum of x and y   \n",
       "1             x - y                              difference of x and y   \n",
       "2             x * y                                 product of x and y   \n",
       "3             x / y                                quotient of x and y   \n",
       "4            x // y                        floored quotient of x and y   \n",
       "5             x % y                                 remainder of x / y   \n",
       "6                -x                                          x negated   \n",
       "7                +x                                        x unchanged   \n",
       "8            abs(x)                   absolute value or magnitude of x   \n",
       "9            int(x)                             x converted to integer   \n",
       "10         float(x)                      x converted to floating point   \n",
       "11  complex(re, im)  a complex number with real part re, imaginary ...   \n",
       "12    c.conjugate()                  conjugate of the complex number c   \n",
       "13     divmod(x, y)                           the pair (x // y, x % y)   \n",
       "14        pow(x, y)                                   x to the power y   \n",
       "15           x ** y                                   x to the power y   \n",
       "\n",
       "     Notes Full documentation  \n",
       "0      NaN                NaN  \n",
       "1      NaN                NaN  \n",
       "2      NaN                NaN  \n",
       "3      NaN                NaN  \n",
       "4      (1)                NaN  \n",
       "5      (2)                NaN  \n",
       "6      NaN                NaN  \n",
       "7      NaN                NaN  \n",
       "8      NaN              abs()  \n",
       "9   (3)(6)              int()  \n",
       "10  (4)(6)            float()  \n",
       "11     (6)          complex()  \n",
       "12     NaN                NaN  \n",
       "13     (2)           divmod()  \n",
       "14     (5)              pow()  \n",
       "15     (5)                NaN  "
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pd.read_html(\"https://docs.python.org/3.8/library/stdtypes.html#numeric-types-int-float-complex\")[2]"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5d294a10",
   "metadata": {},
   "source": [
    "### 3.2 数值的一般方法（Methods）\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "8967defe",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "b'\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x04\\x00'"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(1024).to_bytes(10, byteorder='big') ## bytes 类型的数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "id": "be07bf04",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "True"
      ]
     },
     "execution_count": 25,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "(2.0).is_integer()# 判断浮点数是不是一个整数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "id": "f58a5dd9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "False"
      ]
     },
     "execution_count": 26,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "2.2.is_integer()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d5acb01e",
   "metadata": {},
   "source": [
    "##  4. 字符串\n",
    "* 课后：\n",
    "> 1. 什么是字符串\n",
    "> 2. 字符串的一般表现形式\n",
    "> 3. 字符串的运算有哪些 如： + 是什么意思，取值，切片，索引的概念是什么\n",
    "> 4. 字符串一般方法 如 ：count(), in\n",
    "> 5. 字符串的一般方法？如"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "77b1fb24",
   "metadata": {},
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "0cbb7ad1",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e56e8ab4",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
